<template>
    <div>
        <div id="mycharts" style="width: 600px;height:400px;">

        </div>
    </div>
</template>

<script>
export default {
    name: "money",
    data(){
        return{

        }
    },
    methods:{
        get_info(){
            this.$axios.get('money/').then(resp=>{
                console.log(resp.data)
                let myChart = this.$echarts.init(document.getElementById('mycharts'))

                myChart.setOption({
                    title: {text: '美元汇率'},
                    tooltip:{},
                    xAxis:{
                        data: resp.data.date
                    },
                    yAxis:{
                        type: 'value',
                        min: 652,
                        max: 653
                    },
                    series:[{
                        name: '汇率',
                        type: 'line',
                        data: resp.data.huilv
                    }]
                })
            })
        }
    },
    mounted() {
        this.get_info()
    }
}
</script>

<style scoped>

</style>
